package org.elfen.common.filter;

import javax.servlet.http.HttpServletRequest;


public interface BaseTokenFilterOption {

	void validateTokenInfo(String tokenKey, HttpServletRequest request);
	
	/**
	 * 
	 * TokenUtil tokenUtil = new TokenUtil();
		Token tokenInfo = tokenUtil.getTokenInfo(tokenKey);
		logger.info("进行token验证,tokenInfo={}",tokenInfo);
		if (tokenInfo != null) {
			//清除当前session中的user
			WebUtil.removeCurrentUser(request);
			Long now = System.currentTimeMillis();
			if (now - tokenInfo.getTime() < 1000 * Integer.parseInt(Constants.TOKEN_EXPIRATION)) {
				Serializable userId = tokenInfo.getUserId();
				String userName = tokenInfo.getUserName();
				//重新设置Token时间
				tokenUtil.setTokenInfo(userId,userName, tokenKey);
				
				//将userId添加到但是session中
				WebUtil.saveCurrentUser(request, userId);
			}
		}
		
	 */
}
